namespace Maple.Branch.Tenants
{
    using AutoMappers;
    using Entities;
    using Etos;
    using Microsoft.Extensions.DependencyInjection;
    using Volo.Abp.AutoMapper;
    using Volo.Abp.Data;
    using Volo.Abp.Domain;
    using Volo.Abp.EventBus.Distributed;
    using Volo.Abp.Modularity;

    [DependsOn(typeof(AbpDddDomainModule),
        typeof(AbpAutoMapperModule),
        typeof(AbpDataModule),
        typeof(TenantsCommonModule))]
    public class TenantsDomainModule : AbpModule
    {
        public override void ConfigureServices(ServiceConfigurationContext context)
        {
            context.Services.AddAutoMapperObjectMapper<TenantsDomainModule>();

            Configure<AbpAutoMapperOptions>(options =>
            {
                options.AddProfile<TenantsMapperProfile>(validate: true);
            });

            Configure<AbpDistributedEventBusOptions>(options =>
            {
                options.EtoMappings.Add<Tenant, TenantEto>();
            });
        }
    }
}
